package Jona;

/**
 * @author Xox Ix
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public interface ArgObject {
		
	//evaluation states
	public final static int EVALUATION_UNDEFEATED = 1;
	public final static int EVALUATION_UNKNOWN = 0;
	public final static int EVALUATION_DEFEATED = -1;
	public final static int EVALUATION_UNASSIGNED = -255;
	
	//argument type 
	public final static int ANTI_ASSUMPTION = -1;
	public final static int UNDEFINED = 0;
	public final static int ASSUMPTION = 1;
	public final static int ISSUE = 2;
	public final static int NEGATION = 4;
	
	
	/**
	 * Evaluates the evaluation of this statement based upon the 
	 * given theory.
	 * @param th Theory evaluating this statement
	 * @return
	 * Statement.EVALUATION_UNASSIGNED if the Theory is null,
	 * Statement.EVALUATION_UNDEFEATED if the statement was positively justified, 
	 * Statement.EVALUATION_DEFEATED if the statement was positively defeated,
	 * Statement.EVALUATION_UNKNOWN otherwise
	 */
	public int evaluate(Theory th);
	
	/**
	 * Returns the negated Statement
	 * @return negation of this Statement
	 */
	public ArgObject getNegation();
	
	
//	public void setText(String text);
	
	/**
	 * Clears the list of attackers
	 */
	public void removeAllAttackers();
	
	/**
	 * Clears the list of supporters
	 */
	public void removeAllSupporters();
	
	/**
	 * Adds a Statement to the list of attacking conditionals
	 * @param attacker Statement to add to the list of attackers
	 */
	public void addAttackingConditional(ArgObject attacker);

	/**
	 * Adds a Statement to the list of attackers
	 * @param attacker Statement to add to the list of attackers
	 */
	public void addAttacker(ArgObject attacker);
	
	
	/**
	 * Adds a Statement to the list of supporters
	 * @param supporter Statement to add to the list of supporters
	 */
	public void addSupportingConditional(ArgObject supporter);
	
	/**
	 * Adds a Statement to the list of supporters
	 * @param attacker Statement to add to the list of supporters
	 */
	public void addSupporter(ArgObject supporter);
	
	/**
	 * Removes a conditional facilitating a supporter from the list
	 * @param supporter Statement to remove from the list of supporters
	 */
	public void removeSupportingConditional(ArgObject supporter);

	/**
	 * Removes a conditional facilitating an attacker from the list
	 * @param attacker Statement to remove from the list of attackers
	 */
	public void removeAttackingConditional(ArgObject attacker);

	/**
	 * Removes a supporter from the list
	 * @param supporter Statement to remove from the list of supporters
	 */
	public void removeSupporter(ArgObject supporter);

	/**
	 * Removes an attacker from the list
	 * @param attacker Statement to remove from the list of attackers
	 */
	public void removeAttacker(ArgObject attacker);

	/**
	 * Returns the string representation
	 * @return the string representation of this Statement
	 */
	public String toString();

	/**
	 * Returns the label text
	 * @return the label text of this Statement
	 */
	public String getText();

	/**
	 * Sets the text to a new value
	 * @param newText new value for the text
	 */
	public void setText(String newText);
	
	public boolean hasName();

	/**
	 * Returns the list of conditionals representing an attack
	 * @return list of Conditionals attacking this Statement
	 */
	public ArgObject[] getAttackingConditionals();

	/**
	 * Returns the list of attackers
	 * @return list of ArgObjects attacking this Statement
	 */
	public ArgObject[] getAttackers();

	/**
	 * Returns the list of conditionals representing a support
	 * @return list of Conditionals supporting this Statement
	 */
	public ArgObject[] getSupportingConditionals();

	/**
	 * Returns the list of supporters
	 * @return list of ArgObjectts supporting this Statement
	 */
	public ArgObject[] getSupporters();

	/**
	 * Determines whether this statement is attacked by the given statement.  
	 * @param st Statement to determine attacking relation
	 * @return
	 * true if this statement is attacked by st,
	 * false otherwise
	 */
	public boolean isAttackedBy(ArgObject st);
	
	/**
	 * Determines whether this statement is attacking the given statement.  
	 * @param st Statement to determine attacking relation
	 * @return
	 * true if this statement is attacking st,
	 * false otherwise
	 */
	public boolean isAttackerOf(ArgObject st);
	
	/**
	 * Determines whether this statement is supported by the given statement.  
	 * @param st Statement to determine supporting relation
	 * @return
	 * true if this statement is supported by st,
	 * false otherwise
	 */
	public boolean isSupportedBy(ArgObject st);
	
	/**
	 * Determines whether this statement is supporting the given statement.  
	 * @param st Statement to determine supporting relation
	 * @return
	 * true if this statement is supporting st,
	 * false otherwise
	 */
	public boolean isSupporterOf(ArgObject st);
	
	/**
	 * Resets the argument type to a new value
	 * @param type the new value of the argument type:
	 * ASSUMPTION if this Statement is assumed to be true (until proven otherwise),
	 * ASSUMPTION if this Statement is not assumed to be true,
	 * UNDEFINED otherwise
	 */
	public void setArgumentType(int type);
	
	/**
	 * Returns the argument type
	 * @return
	 * ASSUMPTION if this Statement is assumed to be true (until proven otherwise),
	 * ASSUMPTION if this Statement is not assumed to be true,
	 * UNDEFINED otherwise
	 */
	public int getArgumentType();

	public String getUnparsedText();

	public ArgObject giveCopy();
	public String getName();
	public void setName(String newName);
	public void addedInformation(boolean value);
	public void setEvaluation(int value);
}
